package com.itheima.day16_多态接口.demo05;

//定义USB接口
public interface USB {
    void Open();

    void Close();
}

//定义笔记本类
class Notebook {

    public void Open() {
        System.out.println("笔记本开机");
    }

    public void Close() {
        System.out.println("笔记本关机");
    }

    public void UseUsb(USB u){
        u.Open();
        u.Close();
    }
}

class Mouse implements USB {

    @Override
    public void Open() {
        System.out.println("连接鼠标的USB");
    }

    @Override
    public void Close() {
        System.out.println("断开鼠标的USB");
    }
}

class KeyBoard implements USB {

    @Override
    public void Open() {
        System.out.println("连接键盘的USB");
    }

    @Override
    public void Close() {
        System.out.println("断开键盘的USB");
    }
}